package com.phoenix.jsef.code.generator.template;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.phoenix.jsef.code.generator.provider.SchemaProviderFactory;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;

@Component
public class TemplateMethodForGetDataType implements TemplateMethodModel{
	
	@Autowired
	private  SchemaProviderFactory schemaProviderFactory;
	
	@Override
	public Object exec(List arg0) throws TemplateModelException {
		
		return schemaProviderFactory.createDbSchemaProvider().getDataType(arg0.get(0).toString());
	}

}
